#ifndef COMMONDEFEXTENTION_H_
#define COMMONDEFEXTENTION_H_

//SPL 2010
//Assignment 2
//commonDefExtention.h

//Last change 19/12/09
//Adds functions to switch between enumerators and string/int etc
//Writen as an extention to CommonDef.h, provided by the SPL team.

#include "CommonDef.h"

namespace ass2{

	// Define a postfix increment operator for eEnergy.
	inline ass2::eEnergy operator++( ass2::eEnergy &rs, int )
	{
		return rs = (ass2::eEnergy)(rs + 1);
	}

	// Define a postfix increment operator for eUser.
	inline ass2::eUser operator++( ass2::eUser &rs, int )
	{
		return rs = (ass2::eUser)(rs + 1);
	}

	//creates an eUser according to the id
	inline ass2::eUser Id2eUser(int id)
		{
			switch (id){
				case 13 :		    return ass2::eAlon;
				case 19 :		    return ass2::eCherny;
				case 22 :		    return ass2::eGorovoy;
				case 32 :		    return ass2::eGutman;
				case 51 :			return ass2::eKatz;
				case 59 :	        return ass2::ePoster;
				case 62 :			return ass2::eSaya;
				case 75 :           return ass2::eSoref;
				case 88 :           return ass2::eToman;
				case 95 :  		    return ass2::eWeis;
				case 99 :           return ass2::eZolotowski;
				default :			return ass2::eNoUser;
			}
		}

} //namespace
#endif /*COMMONDEFEXTENTION_H_*/
